#ifndef LIBACCENT_ALGORITHMS_DROP_HPP
#define LIBACCENT_ALGORITHMS_DROP_HPP

#include "accent/core.hpp"
#include <cstddef>

namespace accent
{

  namespace detail
  {

    template <typename Range>
    Range drop_impl(std::size_t n, Range r, single_pass_traversal_tag) {
      for (std::size_t i = 0; i < n && !r.empty(); ++i) {
        r.pop_front();
      }
      return r;
    }

    template <typename Range>
    Range drop_impl(std::size_t n, Range r, random_access_traversal_tag) {
      r.skip_front(n);
      return r;
    }

  }

  template <typename Range>
  Range drop(std::size_t n, Range r) {
    return detail::drop_impl(n, r, typename Range::traversal());
  }

}

#endif
